import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import User from '../views/User.vue'
import Menu from '../views/Menu.vue'
import Role from '../views/Role.vue'
import Dept from '../views/Dept.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    meta: "首页",
    component: Home,
    children: [
      {
        path: '/user',
        name: 'user',
        meta: "用户管理",
        component: User
      },
      {
        path: '/menu',
        name: 'menu',
        meta: "菜单管理",
        component: Menu
      },
      {
        path: '/role',
        name: 'role',
        meta: "角色管理",
        component: Role
      },
      {
        path: '/dept',
        name: 'dept',
        meta: "部门管理",
        component: Dept
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
